package com.qf.mapper;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qf.pojo.RevisitPatientVo;
import com.qf.pojo.RevisitPojo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Mapper
public interface RevisitMapper extends BaseMapper<RevisitPojo> {

    @Select("SELECT * FROM revisit r LEFT JOIN patient p ON r.patient_id=p.patient_id LEFT JOIN user u ON u.user_id=p.user_id ${ew.customSqlSegment}")
    Page<RevisitPatientVo> getPageVo(Page<RevisitPatientVo> page,@Param(Constants.WRAPPER) QueryWrapper<RevisitPojo> wrapper);

    @Select("SELECT * FROM revisit r LEFT JOIN patient p ON r.patient_id=p.patient_id LEFT JOIN user u ON u.user_id=p.user_id ${ew.customSqlSegment}")
    RevisitPatientVo findOne(@Param(Constants.WRAPPER)QueryWrapper<RevisitPatientVo> wrapper);
}
